package com.yami.shop.user.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.model.ShopWithdrawCash;
import com.yami.shop.user.common.dto.UserBalanceWithdrawCashDto;
import com.yami.shop.user.common.model.UserBalanceWithdrawCash;
import com.yami.shop.user.common.param.RangeTimeParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author yami
 */
public interface UserBalanceWithdrawCashMapper extends BaseMapper<UserBalanceWithdrawCash> {
    /**
     * 分页获取分销员提现申请记录
     * @param page 分页参数
     * @param rangeTimeParam 申请时间
     * @param userMobile 手机号
     * @param userBalanceWithdrawCash 查询参数
     * @return 分销员提现申请记录
     */
    IPage<UserBalanceWithdrawCash> userWithdrawCashsPage(Page page, @Param("rangeTimeParam") RangeTimeParam rangeTimeParam, @Param("userMobile") String userMobile,@Param("userName") String userName, @Param("userBalanceWithdrawCash") UserBalanceWithdrawCash userBalanceWithdrawCash);

    /**
     * 分页获取分销员提现申请记录
     * @param page 分页参数
     * @param userId 用户id
     * @return 分销员提现申请记录
     */
    IPage<UserBalanceWithdrawCashDto> userWithdrawCashDtoPageByUserId(Page page, @Param("userId") String userId);

    /**
     * 根据时间区间获取用户的提现次数
     * @param rangeTimeParam 时间范围
     * @param userId 用户id
     * @return 分销员提现申请记录数量
     */
    Integer getCountByRangeTimeAndUserId(@Param("rangeTimeParam") RangeTimeParam rangeTimeParam, @Param("userId") String userId);

    /**
     * 查看用户总提现金额
     * @param walletId 钱包id
     * @return 总提现金额
     */
    Double getUserTotalWithdrawCash(@Param("walletId") Long walletId);

    /**
     * 永久封禁时，根据用户id更新其提现中的记录为拒绝提现
     * @param userId 用户id
     */
    void updateUserByUserId(@Param("userId") String userId);


    /**
     * 获取筛选条件筛选的提现信息
     * @param userBalanceWithdrawCash
     * @return
     */
    List<UserBalanceWithdrawCash> listExportByParam(@Param("shopWithdrawCash")UserBalanceWithdrawCash userBalanceWithdrawCash);
}
